package com.baizhi.service.impl;

import com.baizhi.dao.ManagerDao;
import com.baizhi.entity.Manager;
import com.baizhi.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ManagerServiceImpl implements ManagerService {

    private ManagerDao managerDao;
    @Autowired
    public void setManagerDao(ManagerDao managerDao) {
        this.managerDao = managerDao;
    }

    @Override
    public boolean login(String username, String password) {
        boolean result = false;
        Manager manager = managerDao.selectByUsername(username);
        if(manager!=null&&manager.getPassword().equals(password)){
            result = true;
        }
        return result;
    }
}
